<?PHP
/****************************************/
/************* IdeaLAN LLC **************/
/* Mailer file, will send emails to     */
/* users and customers. Also it will    */
/* send emails with invoices and        */
/* reminders.                           */
/****************************************/
/****************************************/
/* SCRIPT: mailer.php        VER: 0.9b  */
/* AUTHOR: Lukasz Piekarski             */
/* E-mail: lukasz@idealan.net           */
   $mailer_ver = "0.9b";
   $mailer_bdate = "01.2011";
/****************************************/
/* Email templates are located in       */
/* ./templates/email/*.mail from        */
/* mailer.php. You can see an example   */
/* of email template in example.mail    */
/****************************************/
/****************************************/
/* INCLUDE FILES */
require_once("../domain/Signup.php");
require_once("../services/SignupService.php");
require_once("../domain/Log.php");
require_once("../services/LogService.php");
require_once("../domain/AccessPage.php");
require_once("../services/AccessPageService.php");
require_once("../domain/Access.php");
require_once("../services/AccessService.php");
require_once("../domain/Module.php");
require_once("../services/ModuleService.php");
include("membersonly.inc.php");
//require_once ($conf_apath."PEAR/Mail.php");

/* VARIABLES FROM URL */
$temp = $_GET["temp"];
$send = $_GET["send"];
$do = $_GET["do"];
$mid = $_GET["mid"];
	
/* SMTP SETTINGS */
$smtpinfo["host"] = "69.39.89.30";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "mailer@idealan.us";
$smtpinfo["password"] = $mid;

/* EMAIL SETTINGS */
$headers["From"] = "IdeaLAN Mailer <mailer@idealan.us>";
$headers["Reply-To"] = "IdeaLAN Service <service@idealan.net>";

/* CREAT MAIL OBJECT */
//$mail_object =& Mail::factory("smtp", $smtpinfo);

/* #*#*#*#*#*#*#*#*#*#*#*#*# INCLUDE EMAIL TEMPLATE #*#*#*#*#*#*#*#*#*#*#*#*#*#*# */
$mail_file = "./templates/email/" . $temp . ".mail";


                                


//$tresc = $_GET['txtKontakt'];
//$mail = $_GET['mailKontakt'];
//$headers = 'From: IdeaLAN Mailer <mailer@idealan.us>' . "\r\n" .
//'Reply-To: IdeaLAN Service <service@idealan.net>' . "\r\n";
////'X-Mailer: PHP/' . phpversion();
////$headers.= "MIME-Version: 1.0\n";
//$headers.= "Content-Type: text/html;\n";
////$headers.= "\tcharset=\"UTF-8\"\n";
////$headers.= "Content-Transfer-Encoding: 8bit\n\n";
//
//if(mail('anfirma@o2.pl', "Nadawca: ".$mail, $tresc."\r\n".$mail, $headers)) {
//    echo "Wyslano maila";
//}
//else {
//    echo "Nie udalo sie wyslac maila";
//}
//




if (file_exists($mail_file)) {

	include ($mail_file);

} else {
	
	header ("Location: in.php?e=23&temp=$temp");
	die();
}

/* #*#*#*#*#*#*#*#*#*#*#*#*# INCLUDE EMAIL TEMPLATE #*#*#*#*#*#*#*#*#*#*#*#*#*#*# */
?>